package org.msi.bayesiannetwork;

/**
 * <p>Represents a conditional variable within bayesian network.</p>
 *
 * @author Jakub Narloch
 * @version 1.0
 */
public class ConditionalNode extends AbstractNode {

    /**
     * <p>Represents the conditional probability.</p>
     */
    private ConditionalProbability conditionalProbability;

    /**
     * <p>Creates new instance of {@link ConditionalNode} with specified name, alias and conditional
     * probability.</p>
     *
     * @param name                   the node name
     * @param alias                  the node alias
     * @param conditionalProbability the conditional probability
     */
    public ConditionalNode(String name, String alias, ConditionalProbability conditionalProbability) {
        super(name, alias);

        this.conditionalProbability = conditionalProbability;
    }

    /**
     * <p>Retrieves the conditional probability.</p>
     *
     * @return the conditional probability
     */
    public ConditionalProbability getConditionalProbability() {
        return conditionalProbability;
    }

    /**
     * <p>Sets the conditional probability.</p>
     *
     * @param conditionalProbability the conditional probability
     */
    public void setConditionalProbability(ConditionalProbability conditionalProbability) {
        this.conditionalProbability = conditionalProbability;
    }
}
